/**
 * 
 */
package com.sj.szxy.courseschedule.entity.course;

import java.util.Set;

import com.sj.szxy.courseschedule.entity.AdministrativeClass;
import com.sj.szxy.courseschedule.entity.Subject;
import com.sj.szxy.courseschedule.entity.Teacher;

/**
 * @author Yi Ping
 * @date 2018年3月29日 下午9:18:24 
 * @since 1.0.0
 *
 */
public class AdministractiveCourse extends AbstractSimpleCourse{
	
	private AdministrativeClass administrativeClass;
	
	


	/**
	 * @param subject
	 * @param teacher
	 */
	public AdministractiveCourse(Subject subject, Teacher teacher, AdministrativeClass class1) {
		super(subject, teacher);
		this.administrativeClass = class1;
	}


	@Override
	public Set<AdministrativeClass> getAdministractiveClasses() {
		Set<AdministrativeClass> classes = super.getAdministractiveClasses();
		classes.add(administrativeClass);
		return classes;
	}


	public AdministrativeClass getAdministrativeClass() {
		return administrativeClass;
	}


	public void setAdministrativeClass(AdministrativeClass administrativeClass) {
		this.administrativeClass = administrativeClass;
	}


	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		if(administrativeClass != null)
			builder.append(administrativeClass.toString());
		if(getSegment() != null)
			builder.append(getSegment().toString());
		if(getTeacher() != null)
			builder.append(getTeacher().getName());
		if(getSubject() != null)
			builder.append(getSubject().getName()).append("课");
		
		return builder.toString();
	}
	
	
	
}
